package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 采购配套
 * </p>
 *
 * @author yinjc123
 * @since 2018-04-03
 */
@TableName("crm_purchase")
@Getter
@Setter
@ToString
public class Purchase extends Model<Purchase> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 客户id
     */
    @TableField("customer_company_id")
    @NotNull(message = "客户id不能为空")
    private Integer customerCompanyId;
    /**
     * 年度
     */
    @NotNull(message = "年度不能为空")
    private Integer year;
    /**
     * 供应商名称
     */
    @TableField("provider_name")
    @NotBlank(message = "供应商名称不能为空")
    private String providerName;
    /**
     * 采购商品
     */
    @NotBlank(message = "采购商品不能为空")
    private String product;
    /**
     * 年度采购金额
     */
    @TableField("annual_purchase_amount")
    @NotNull(message = "年度采购金额不能为空")
    private BigDecimal annualPurchaseAmount;
    /**
     * 应付账款余额
     */
    @TableField("account_payable_balance")
    private BigDecimal accountPayableBalance;
    /**
     * 现金付款量
     */
    @TableField("cash_paid")
    private BigDecimal cashPaid;
    /**
     * 银票付款量
     */
    @TableField("silver_ticket_paid")
    private BigDecimal silverTicketPaid;
    /**
     * 商票付款量
     */
    @TableField("business_ticket_paid")
    private BigDecimal businessTicketPaid;
    /**
     * 一般期限
     */
    private Integer period;
    /**
     * 商票贴现量
     */
    @TableField("business_ticket_discount")
    private BigDecimal businessTicketDiscount;
    /**
     * 贴现利率
     */
    @TableField("discount_Interest_rate")
    private BigDecimal discountInterestRate;
    /**
     * 供应商供货余额
     */
    @TableField("provider_product_balance")
    private BigDecimal providerProductBalance;

    /**
     * 逻辑删除
     */
    @TableField(value = "delete_flag")
    @TableLogic
    private Integer deleteFlag;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
